<template>
    <div>
        <header>
            <div class="centerBox clearfix">
                <a href="" class="logo">
                    <img src="../common/images/logo1.png" style="width: 5.83rem;height: 0.51rem;"/>
                </a>
	            <div class="nav">
                  <router-link class="nav-link" :class="{'cur':name=='InventoryOverview'}" @click.native="tabName('InventoryOverview')" to="/InventoryOverview">库存总览</router-link>
	                <router-link class="nav-link" :class="{'cur':name=='IntelligentClassification'}" @click.native="tabName('IntelligentClassification')" to="/IntelligentClassification">智能分析</router-link>
	                <router-link class="nav-link" :class="{'cur':name=='decision'}" @click.native="tabName('decision')" to="/decision">智能决策</router-link>
	                <router-link class="nav-link" :class="{'cur':name=='IntelligentFeedback'}" @click.native="tabName('IntelligentFeedback')" to="/IntelligentFeedback">智能反馈</router-link>
              </div>
              <ul class="nav-list clearfix">
                <li>
                  <a class="cursor">首页</a>
                </li>
                <li>
                  <a class="cursor">帮助</a>
                </li>
                <li>
                  <a class="cursor" href="javascript:;" v-on:click="outFunction()">注销</a>
                </li>
              </ul>
                <!--<ul class="nav-list clearfix">
                	<li>
                        <a>{{employee}}</a>
                    </li>
                    <li>
                        <a class="cursor" href="javascript:;" v-on:click="outFunction()">注销</a>
                    </li>
                  <li v-if="employee==1024">
                    <router-link to="/index/manager" @click.native="tabName('')">用户管理</router-link>
                  </li>
                </ul>-->
            </div>
          <div class="header_bt_block"></div>
        </header>
        <router-view></router-view>

        <footer>copyright@杭州览众数据科技有限公司版权所有</footer>
    </div>
</template>

<script>
    import common from '../common/js/common';
    import headers from './login';
    export default{
        components:{
            headers
        },
        data(){
            return{
                menuList:[],
                list:[],
                name:"IntelligentFeedback",
                employee:'',
                roleID:''
            }
        },
        methods:{
        	tabName:function(name){
        		this.name = name;
        	},
        	outFunction:function(){
        		var _self = this;
            _self.$router.push({path: '/login'});
        		common.getData(-1, common.url_constitute.logout, "post", {}, function (d) {
		            if (d.data.code == 1024) {
		            	localStorage.clear();
		            } else {
		              alert(d.data.message)
		            }
	            });
        	}
        },
       /* created(){
            common.rem();
            window.onresize=function(){
                common.rem();
            };
        },*/
        mounted(){
          this.roleID=localStorage.getItem("role_id");
          this.employee=localStorage.getItem('employee_name');
            window.onresize=function(){
                common.footer();
            };
            common.footer()
            var startName = window.location.href.split("/")[window.location.href.split("/").length-1];
            if(startName=="basis"||startName=="proposal"||startName=="forecast"){
           		this.name="decision";
            }else if(startName=="item"||startName=="supplier"||startName=="relative"){
           		this.name="IntelligentClassification";
            }else if(startName=='IntelligentFeedback'){
            	this.name="IntelligentFeedback";
            }else if(startName=='manager'){
              this.name='';
            }

        }
    }
</script>

<style type="text/css">
    @import '../common/css/base.css';
    @import '../common/css/index.css';
</style>
